<?php namespace App;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;


/**
 * App\UserTeams
 *
 * @property integer $id
 * @property integer $user_id
 * @property string $real_name
 * @property integer $photo_id
 * @property string $position
 * @property string $school
 * @property string $province
 * @property string $city
 * @property string $profile
 * @property string $wechat
 * @property string $weibo
 * @property string $maimai
 * @property integer $status
 * @property string $check_time
 * @property string $deleted_at
 * @property \Carbon\Carbon $created_at
 * @property \Carbon\Carbon $updated_at
 * @property-read \App\User $toUser
 * @property-read \Illuminate\Database\Eloquent\Collection|\App\ProjectTeam[] $projectTeam
 * @method static \Illuminate\Database\Query\Builder|\App\UserTeams whereId($value)
 * @method static \Illuminate\Database\Query\Builder|\App\UserTeams whereUserId($value)
 * @method static \Illuminate\Database\Query\Builder|\App\UserTeams whereRealName($value)
 * @method static \Illuminate\Database\Query\Builder|\App\UserTeams wherePhotoId($value)
 * @method static \Illuminate\Database\Query\Builder|\App\UserTeams wherePosition($value)
 * @method static \Illuminate\Database\Query\Builder|\App\UserTeams whereSchool($value)
 * @method static \Illuminate\Database\Query\Builder|\App\UserTeams whereProvince($value)
 * @method static \Illuminate\Database\Query\Builder|\App\UserTeams whereCity($value)
 * @method static \Illuminate\Database\Query\Builder|\App\UserTeams whereProfile($value)
 * @method static \Illuminate\Database\Query\Builder|\App\UserTeams whereWechat($value)
 * @method static \Illuminate\Database\Query\Builder|\App\UserTeams whereWeibo($value)
 * @method static \Illuminate\Database\Query\Builder|\App\UserTeams whereMaimai($value)
 * @method static \Illuminate\Database\Query\Builder|\App\UserTeams whereStatus($value)
 * @method static \Illuminate\Database\Query\Builder|\App\UserTeams whereCheckTime($value)
 * @method static \Illuminate\Database\Query\Builder|\App\UserTeams whereDeletedAt($value)
 * @method static \Illuminate\Database\Query\Builder|\App\UserTeams whereCreatedAt($value)
 * @method static \Illuminate\Database\Query\Builder|\App\UserTeams whereUpdatedAt($value)
 * @property integer $is_founder
 * @method static \Illuminate\Database\Query\Builder|\App\UserTeams whereIsFounder($value)
 * @property-read \App\Images $toTeamPhoto
 * @property-read \Illuminate\Database\Eloquent\Collection|\App\Project[] $project_x_team
 */
class UserTeams extends Model {

	//表名
    protected $table = "user_teams" ;
    use SoftDeletes;

    /** 关联用户表 */
    public function toUser()
    {
        return $this->belongsTo('App\User' ,'user_id') ;
    }

//    /** 项目团队 */
//    public function projectTeam()
//    {
//        return $this->hasMany('App\ProjectTeam','team_id');
//    }

    /** 团队对成员的logo */
    public function toTeamPhoto()
    {
        return $this->belongsTo('App\Images' , 'photo_id');
    }

    /** 关联中间表-项目成员 */
    public function project_x_team()
    {
        return $this->belongsToMany('App\Project','project_team','team_id','project_id');
    }
}
